﻿//"use strict";


///////////////////// Approach - build up /////////////////////  

// start with flat array:
var tempLocs1 = ["Austin", "Vegas"];

// make it multidimensional (an array in an array)
var tempLocs2 = [["Austin", "Location"], ["Vegas", "Location"]];

// add another dimension to the Location
var tempLocs3 = [["Austin", ["area1", "area2"]], ["Vegas", ["area21", "area22"]]];

// final data
var tempLocs = [["Austin", ["30.2500° N", "97.7500° W"]], ["Vegas", ["36.1215° N", "115.1739° W"]]];

// try outputting the following from the console:
tempLocs            // get the multidimensional array
tempLocs[0]         // get first array                                          // ["Austin", ["30.2500° N", "97.7500° W"]
tempLocs[0][1]      // get second array in first array                          // ["30.2500° N", "97.7500° W"]
tempLocs[0][1][0]   // gets the first value from second array in first array    // "30.2500° N"



///////////////////// Approach - A /////////////////////  
/*
Create the Questions for Jeopardy:
STUCTURE: 
    - set of questions:
        - points
        - question
        - answer
*/
var jeopardyQuestions = [
                            [
                                [10, "The 4th Largest City", "Houston"],
                                [50, "The capitol of Texas", "Austin"],
                                [100, "The capitol of Zimbabwe", "Harare"],
                                [400, "The mayor of Pearland", "Tom Reid"]
                            ],

                            [
                                [10, "The language of the web", "javascript"],
                                [50, "The first language on a mac", "anasewr"],
                                [100, "The language Apple killed", "Actionscript"],
                                [400, "The new Apple language", "Swift"]
                            ],

                            [
                                [10, "He made Facebook", "Mark Zuckerberg"],
                                [50, "He created made Apple", "Steve Jobs"],
                                [100, "He created Paypal", "Elon Musk"],
                                [400, "She is CEO of Yahoo", "Marissa Mayer"]
                            ]
];

/*
Create the Topics for Jeopardy:
STUCTURE: 
    - Topic Title
*/
var jeopardyTopics = ["Geography", "Languages", "Web People"];


/*
Output the data
*/
for (i = 0; i < jeopardyTopics.length; i++) {
    //    console.log(jeopardyTopics[i]);

    var topicPoints = jeopardyQuestions[i];
    //    console.log(topicPoints);

    for (ii = 0; ii < topicPoints.length; ii++) {
        var str = "For $" + topicPoints[ii][0] + " Dollars, " + topicPoints[ii][1] + " - ANSWER: " + topicPoints[ii][2];
        //        console.log(str)
    }

}






///////////////////// Approach - B /////////////////////  

/*
Create the data for Jeopardy:
STUCTURE: 
    - Topics
        - topic title
        - set of questions:
            - points
            - question
            - answer

*/

var jeopardyMaster = [
    ["Geography",
     [
         [10, "The 4th Largest City", "Houston"],
         [50, "The capitol of Texas", "Austin"],
         [100, "The capitol of Zimbabwe", "Harare"],
         [400, "The mayor of Pearland", "Tom Reid"]
     ]
    ],
    ["Languages",
     [
         [10, "The language of the web", "javascript"],
         [50, "The first language on a mac", "answer"],
         [100, "The language Apple killed", "Actionscript"],
         [400, "The new Apple language", "Swift"]
     ]
    ],
    ["Web People",
     [
         [10, "He made Facebook", "Mark Zuckerberg"],
         [50, "He created made Apple", "Steve Jobs"],
         [100, "He created Paypal", "Elon Musk"],
         [400, "She is CEO of Yahoo", "Marissa Mayer"]
     ]
    ]
];

for (i = 0; i < jeopardyMaster.length; i++) {

    //   
    //    // grab the element in the first slot (the Topic Title)
    //    //console.log(jeopardyMaster[i]);
    //    console.log(jeopardyMaster[i][0]);
    //    
    //    // grab the element in the second slot (the list of questions)
    //    console.log(jeopardyMaster[i][1]);
    //    
    //    // grab the fist element for the list of questions (the question)
    //    console.log(jeopardyMaster[i][1][0]);
    //     
    //    // grab the fist element from the first question (the points for the question)
    //    console.log(jeopardyMaster[i][1][0][1]);
    //    
    //    console.log( );

    // grab a refernce of the Multidimensional Array
    var topics = jeopardyMaster[i];

    //grab the Title
    //    console.log(topics[0]);

    //grab the Questions
    var questions = topics[1];
    //    console.log(questions);


    //output all the questions
    for (ii = 0; ii < questions.length; ii++) {
        //        console.log(questions[ii][0]);  // points
        //        console.log(questions[ii][1]);  // question
        //        console.log(questions[ii][2]);  // answer
    }


}